package com.beverages.files.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.beverages.files.entity.Files;
import com.beverages.files.service.IFilesService;
import com.beverages.files.mapper.FilesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FilesService extends ServiceImpl<FilesMapper, Files> implements IFilesService {
    @Autowired
    private FilesMapper filesMapper;

    @Override
    public String getFileUrlById(Integer fileId) {
        Files singleFile = filesMapper.selectById(fileId);
        return singleFile != null ? singleFile.getUrl() : null;
    }
}
